from django.contrib import admin
from .models import *


# Register your models here.
@admin.register(Class)
class ClassAdmin(admin.ModelAdmin):
    list_display = ('classname', 'wx_group')
    # list_editable = ('classname',)


admin.site.site_header = '体院信息管理'
admin.site.site_title = '体院信息管理'
admin.site.index_title = '体院信息管理'


@admin.register(Student)
class StudentAdmin(admin.ModelAdmin):
    list_display = (
        'cla', 'status', 'name', 'gender', 'nation', 'idcard', 'stu_card', 'phone', 'dorm', 'admission_time', 'wx_id')
    list_editable = ('status',)
    search_fields = ('name', 'idcard', 'stu_card')
    list_filter = ('cla__ins__ins_name', 'cla', 'dorm', 'admission_time', 'nation')
    list_per_page = 30


@admin.register(Employment)
class EmploymentAdmin(admin.ModelAdmin):
    list_display = ('student', 'unit')
    search_fields = ('student', 'unit')
    list_filter = ('student__cla', )


@admin.register(Institution)
class EmploymentAdmin(admin.ModelAdmin):
    list_display = ('ins_name', )
